﻿using System;
using System.Collections.Generic;
using System.Text;
using AAA.Base.Util;

namespace AAA.DataTransfer
{
    public class MonthToQuarterTranslate : AbstractTranslate
    {
        #region ITranslate 成員

        protected override object TryTranslate(object oValue)
        {
            
            return  (oValue.GetType() == typeof(DateTime))
                        ?   DateTimeHelper.QuoterFromMonth(((DateTime)oValue).ToString("yyyy/MM"))
                        :   DateTimeHelper.QuoterFromMonth(oValue.ToString());
        }

        #endregion
    }
}
